Network equipment (such as a switch) including a switch chip is network equipment for forwarding electric signals, and it can provide a dedicated electric signal channel for any two network nodes accessing the network equipment. A switching technology is widely used in the field of Internet, but the problem of packet loss caused by switching in a network is always thorny. There are various reasons for packet loss, such as message discarding caused by a Cyclical Redundancy Check (CRC) error, message discarding caused by incapability of passing check of a Virtual Local Area Network (Vlan) and message discarding under a port congestion condition of a switch chip. Packet discarding phenomena occur highly randomly, packets are continuously discarded sometimes, and sometimes, one in a hundred thousands of packets is discarded or a few packets are discarded in a long period of time.
In a packet discarding method adopted in the related art, attentions are only paid to conditions for packet discarding and which kinds of packets are to be discarded, and if a message needs to be discarded, the message is directly discarded without any other processing. Therefore, if it is necessary to know the specific packets discarded by a switch chip and reasons for discarding these packets, high manpower and time consumptions are required to find out the discarded packets from massive messages and analyze and check the reasons for discarding these packets one by one.
Therefore, how to rapidly know specific packets discarded by a switch chip and reasons for discarding these packets is a problem to be solved in the related art.